home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / DOpus_SDK_5.5 / docs / locale.doc < prev    next >
Text File  |  1996-09-05  |  2KB  |  57 lines

  1. TABLE OF CONTENTS
  2.  
  3. dopus5.library/DOpusGetString
  4. dopus5.library/DOpusGetString                   dopus5.library/DOpusGetString
  5.  
  6.     NAME
  7.         DOpusGetString - get a text string from the locale table
  8.  
  9.     SYNOPSIS
  10.         DOpusGetString(locale, id)
  11.                          A0    D0
  12.  
  13.         STRPTR DOpusGetString(struct DOpusLocale *, long);
  14.  
  15.     FUNCTION
  16.         This routine searches the string table referenced by the supplied
  17.         DOpusLocale structure for the string matching the supplied ID,
  18.         and returns a pointer to it.
  19.  
  20.         The DOpusLocale structure must be initialised in the following way :
  21.  
  22.             li_LocaleBase   - locale.library base address, or NULL
  23.             li_Catalog      - OpenCatalog() result, or NULL
  24.             li_BuiltIn      - default string table
  25.             li_Locale       - current system locale or NULL
  26.  
  27.         If there is no external catalog file, or locale.library is not
  28.         available, all fields except li_BuiltIn must be initialised to
  29.         NULL. li_BuiltIn MUST point to a table of default strings. This
  30.         table is in the CatComp block format. The easiest way to initialise
  31.         this pointer is to have a separate source module to a) include
  32.         the string table, and b) initialise the pointer. For example,
  33.  
  34.             #define CATCOMP_BLOCK
  35.             #include "strings.h"
  36.  
  37.             void init_locale_ptr(struct DOpusLocale *locale)
  38.             {
  39.                 locale->li_BuiltIn=(char *)CatCompBlock;
  40.             }
  41.  
  42.     INPUTS
  43.         locale - pointer to initialised DOpusLocale structure.
  44.         id - string ID to return.
  45.  
  46.     RESULT
  47.         Returns a pointer to the requested string. If there is no catalog,
  48.         or the given string is not in the supplied catalog, the default
  49.         string is returned. This pointer is READ-ONLY!
  50.  
  51.         You MUST NOT pass invalid string IDs to this routine.
  52.  
  53.     SEE ALSO
  54.         locale.library/OpenLocale(), locale.library/OpenCatalog(),
  55.         locale.library/GetLocaleStr()
  56.  
  57.